package com.vegetable.modules.entity.inbound;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import com.vegetable.modules.entity.stock.Stock;
import com.vegetable.modules.entity.stock.to.StockFlowDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 入库-代办交货
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AgentDelivery对象", description="入库-代办交货")
public class AgentDelivery extends BaseEntity {

    private Integer producerId;

    @ApiModelProperty(value = "单号")
    private String docNo;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    private Date orderTime;

    @ApiModelProperty(value = "代办人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long agentId;

    @ApiModelProperty(value = "代办人名称")
    private String agentName;

    @ApiModelProperty(value = "应付代办的金额")
    private BigDecimal agentArrears;

    @ApiModelProperty(value = "作业人员id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long workerId;

    @ApiModelProperty(value = "作业人员姓名")
    private String workerName;

    @ApiModelProperty(value = "’完成‘Tab 的已/未结账")
    private Integer checkout;

    @ApiModelProperty(value = "检出时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date checkoutTime;

    @ApiModelProperty(value = "商品名拼接")
    private String commodityNames;

    @ApiModelProperty(value = "支付完成标识0未对账，1已付款,2已对账未付款")
    private Integer isPayFinish;

    @ApiModelProperty(value = "是否已共享0未共享，1已共享")
    private Integer isShare;

    @ApiModelProperty(value = "订单来源0订货发货，1新建")
    private Integer orderSource;

    @ApiModelProperty(value = "订单金额合计")
    private BigDecimal money;

    @ApiModelProperty(value = "商品货款")
    private BigDecimal goodsMoney;

    @ApiModelProperty(value = "总数量")
    private Integer number;

    @ApiModelProperty(value = "总重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "班组id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long teamId;

    @ApiModelProperty(value = "班组名称")
    private String teamName;

    @ApiModelProperty(value = "代加工费")
    private BigDecimal teamMoney;

    @ApiModelProperty(value = "0下达,1代录,2确认,3完成")
    private Integer state;

    @ApiModelProperty(value = "0未入库，1部分入库，2已入库")
    private Integer orderStatus;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "班组欠款")
    private BigDecimal teamArrears;

    @ApiModelProperty(value = "未对账金额")
    private BigDecimal verifyMonet;

    @ApiModelProperty(value = "创建者ID")
    private Long createUserId;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "商品明细")
    @TableField(exist = false)
    private List<AgentDeliveryDetail> commodities;

    @ApiModelProperty(value = "其他费用")
    @TableField(exist = false)
    private List<OrderCost> costs;

    @ApiModelProperty(value = "销售出库详情")
    @TableField(exist = false)
    private List<StockFlowDTO> stockFlows;

    @ApiModelProperty(value = "库存详情")
    @TableField(exist = false)
    private List<Stock> stocks;

    @ApiModelProperty(value = "折扣")
    private BigDecimal discount;

    @ApiModelProperty(value = "溢价")
    private BigDecimal premium;

    @ApiModelProperty(value = "台账")
    private Integer regionId;

    @ApiModelProperty(value = "订单原文附件")
    private String orderImage;
}
